package prickworlds.game;

import static org.lwjgl.opengl.GL11.*;
import prickworlds.graphics.Texture;
import prickworlds.physics.RectRigidBody;

/**
 * @author Faruk Acibal, Richard Dziambor, Christian Holzreuter, Nicolas Winkler
 * 
 */
public class Wall extends SolidObject {
	int mapX;
	int mapY;

	Map map;
	Texture[] textures;
	static int usedTexture;

	public Wall(int mapX, int mapY, Map map) {
		super(mapX, mapY);
		this.mapX = mapX;
		this.mapY = mapY;
		this.map = map;
		this.setHitbox(new RectRigidBody(0, 0, 1f, 1f));
		getHitbox().setPos(mapX, mapY);
		getHitbox().setFix(true);
	}

	@Override
	public void update() {
	}

	@Override
	public void display() {
		glColor3f(1f, 1f, 1f);
		glEnable(GL_TEXTURE_2D);
		textures[usedTexture].bind();
		textures[usedTexture].display(posX, posY, 1f, 1f);
		glDisable(GL_TEXTURE_2D);
	}

	public Texture[] getTexture() {
		return textures;
	}

	public void setTextures(Texture[] textures) {
		this.textures = textures;
	}

	public static int getUsedTexture() {
		return usedTexture;
	}

	public static void setUsedTexture(int usedTexture) {
		Wall.usedTexture = usedTexture;
	}
}
